#include <cstdio>
#include <cstdlib>

#define THREAD 12
const double dx = 1.0 / THREAD;

int main() {
	char buffer[100];

	int i;
	double x;

	system("mkdir -p result");

	for (i = 0, x = 0.0; i < THREAD; i++, x += dx) {
		sprintf(buffer, "./calpi %.14lf %.14lf 1099511627776.0 > ./result/%d.txt &",
			x, x + dx, i);
		system(buffer);
	}

	return 0;
}